<?php
    $time = microtime();

    require '../../conf/lock.php';

    $bolsa = new acadBolsasRecord();
	$lib = new Lib();
	
	$bolsas = $bolsa->listarBolsas();
	
	$tpl = new sistTemplate(APPTPLDIR.'/regraBolsa.tpl.html');
    $tpl->addFile('TOPO', APPTPLDIR.'/topo.tpl.html');
    $tpl->addFile('MENULATERAL', APPTPLDIR.'/menuLateral.tpl.html');
    $tpl->addFile('RODAPE', APPTPLDIR.'/rodape.tpl.html');
    $tpl->IMAGEDIR = APPIMAGEDIR;
    $tpl->CSSDIR = APPCSSDIR;
    $tpl->JSDIR = APPJSDIR;
    $tpl->WEBROOT = APPWEBROOT;
    $tpl->SITETITLE = SITETITLE;
    $tpl->FAVICON = FAVICON;
    $tpl->ANIMATEDFAVICON = ANIMATEDFAVICON;
    $tpl->MEMORYUSAGE = number_format(intval(memory_get_usage()/1000), 0, ',', '.');
    $tpl->MEMORYPICK = number_format(intval(memory_get_peak_usage()/1000),0,',','.');
	$tpl->CONTROLLER = '../controllers/regraBolsa.php?acao=add';
	$tpl->INICIAL = '';
	$tpl->FINAL = '';
	$tpl->DESCONTO = '';
	$tpl->VALOR = '';
	$tpl->CODREGRA = '';
	
	$totalBolsas = count($bolsas['COD']);
				
	for($x = 1;$x <= $totalBolsas;$x++)
	{
		$tpl->COD = $bolsas['COD'][$x];
		$tpl->BOLSA = $lib->formatarNome($bolsas['NOME'][$x]);
		$tpl->BOLSAATUAL = '';
		$tpl->block("BLOCK_BOLSAS");
	}

    $tpl->DICA = 'Lorem ipsum dolor sit amet, consectetur
        adipiscing elit. Duis sollicitudin ultrices
        erat vitae sodales. Duis pretium mollis
        risus, sed pellentesque diam accumsan
        et. Vivamus sapien lorem, ullamcorper
        n auctor non, lacinia et arcu.
        Maecenas condimentum tincidunt
        massa.';    

    $tpl->TIME = number_format((microtime() - $time),3,',','.');
    $tpl->show();
?>